package com.design.pattern.factory;

/**
 * @author wangyingjie
 * @date
 * @remark 简单工厂模式
 */
public class PizzaFactory {

    public Pizza createPizza(String type){
        Pizza pizza;
        if (type.equals("cheese")){
            pizza = new CheesePizza();
        }else {
            pizza = new PepperoniPizza();
        }
        return pizza;
    }
}
